#ifndef PBVP_DCTREECONTROL_H
#define PBVP_DCTREECONTROL_H

#include <assert.h>

#include <QDialog>
#include "../../datamanager/fileextensionmanager.h"
#include "ui_dctreecontrol.h"

namespace PBVP {
	class Reg3DVolumeDataNode;
	///
	class DCTreeControl : public QDialog
	{
		Q_OBJECT

	public:
		///
		DCTreeControl(FileExtensionManager* pFileExtManager, QWidget *parent = 0);
		
		///
		~DCTreeControl();

		/// Initialize Dual Contour Tree parameters for a volume data
		void init(Reg3DVolumeDataNode *pVolNode = NULL);

		///
		float getRangeMin() const;

		/// 
		float getRangeMax() const;

		/// 
		int numOfLevels() const;

		///
		QString getVolumeFileName() const {
			return ui.volumeFileName->text();
		}

		///
		int numOfProperties() const {
			return ui.propertyList->count();
		}

		///
		QString getPropertyFileName(int n) const {
#ifdef _DEBUG
			assert(n < numOfProperties());
#endif
			return ui.propertyList->item(n)->text();
		}

		///
		QString getOutputPath() const {
			return ui.DCTFileName->text();
		}

	private slots:
		/// 
		void updateOutputPath(const QString& path);

		///
		void changeVolumeFile();

		/// 
		void changeDCTPath();

		/// 
		void addPropertyFile();

	private:
		Ui::DCTreeControlClass ui;

		FileExtensionManager *m_pFileExtManager;
	};
}

#endif // DCTREECONTROL_H
